<%-- 
    Document   : station
    Created on : 01.07.2012, 22:32:50
    Author     : I
--%>

<%@page import="java.util.List"%>
<%@page import="java.util.List"%>
<%@page import="interf.IStation"%>
<%@page import="bll.BLL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>RentCar</title>
        <meta name="description" content="Auto dealer website">
        <meta name="keywords" content="autos, cars, rent">
        <link href="css/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <body>
        <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td> </td>
        <td width="750" valign="top"><table width="750" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td height="1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td valign="top" background="images/p1-bg.jpg" class="norepeat"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td><img src="images/spacer.gif" alt="" width="1" height="46"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
        <tr>
        <td width="1"><img src="images/spacer.gif" width="17" height="1"></td>
        <td width="1"><img src="images/logo.jpg" alt="" width="50" height="51"></td>
        <td class="c_name">Rent car</td>
        </tr>
        </table></td>
        <td width="1"><img src="images/p2.jpg" alt="" width="331" height="255"></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td height="100%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td width="1" valign="top"><img src="images/spacer.gif" alt="" width="9" height="1"></td>
        <td height="100%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td background="images/menu-1-bg.gif" class="norepeat"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="index.jsp" class="menu_lnk">Главная</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td background="images/menu-2-bg.gif" bgcolor="#3F3F3F" class="norepeat"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="#" class="menu_lnk">О нас</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="#" class="menu_lnk">Наши партнёры</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="city.jsp" class="menu_lnk">Города</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="station.jsp" class="menu_lnk">Станции</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td bgcolor="#3F3F3F"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="1"><img src="images/menu-bullet.gif" alt="" width="36" height="30"></td>
        <td class="menu"><a href="car.jsp" class="menu_lnk">Автомобили</a></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td><img src="images/menu-sep.gif" alt="" width="181" height="1"></td>
        </tr>
        <tr>
        <td height="100%" bgcolor="#3f3f3f">&nbsp;</td>
        </tr>
        <tr>
        <td background="images/menu-bot-bg.gif" class="bgx"><img src="images/menu-bot-bg.gif" width="1" height="97"></td>
        </tr>
        </table></td>
        <td width="1" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <td><img src="images/c-top.jpg" alt="" width="560" height="17"></td>
        </tr>
        <tr>
        <td><h1>Список станций</h1></td>
        </tr>
        <tr>
        <td height="100%" class="body_txt">
            
            <table border="1">
                <tr>
                    <th>
                        №
                    </th>
                    <th>
                        Номер станции
                    </th>
                    <th>
                        Адрес
                    </th>
                    <%if(request.getParameter("idcity")==null){%>
                    <th>
                        Город
                    </th>
                    
                    <th>
                        Регион
                    </th>
                    <%}%>
                <tr>
                <%
                    BLL bll = new BLL();
                    List<IStation> listStation = null;
                    if(request.getParameter("idcity")!=null)
                        listStation = bll.getListStation(Long.parseLong(request.getParameter("idcity")));
                    else
                        listStation = bll.getListStation();
                    for(int i = 0; i < listStation.size(); i++)
                    {
             
                %>
                <tr>
                    <td>
                        <%=i+1%>
                    </td>
                    <td>
                        <a href="car.jsp?idstation=<%=listStation.get(i).getID()%>"><%=listStation.get(i).getNumberOfStation()%></a>
                    </td>
                    <td>
                         <%=listStation.get(i).getAddress()%> 
                    </td>
                    <%if(request.getParameter("idcity")==null){%>
                    <td>
                         <%=listStation.get(i).getCity()%> 
                    </td>
                    <td>
                         <%=listStation.get(i).getRegion()%> 
                    </td>
                    <%}%>
                </tr>
                <%}%>
            </table>
        
        </td>
        </tr>
        </table></td>
        </tr>
        </table></td>
        </tr>
        <tr>
        <td height="1" background="images/bottom-bg.jpg" class="norepeat"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td class="bottom_addr">&copy; 2012 RC. Все права защищены</td>
        </tr>
        </table></td>
        </tr>
        </table></td>
        <td>&nbsp;</td>
        </tr>
        </table>
    </body>
</html>